import { createRouter,createWebHistory} from 'vue-router';
import ChatRoom from '../components/ChatRoom.vue';
import Home from '../components/Home.vue';
import AddFriend from '../components/AddFriend.vue';
import Empty from '../components/Empty.vue';
import SessionWindow from '../components/SessionWindow.vue';
import Login from '../components/Login.vue';
const routes = [
        {
            path: "/index",
            component: Home,
            redirect:"/ChatRoom",
            children:[
                {
                    path: "/ChatRoom",
                    component: ChatRoom,
                    children:[
                        {
                            path:"/ChatRoom/addFriend",
                            component:AddFriend
                        },
                        {
                            path:"/ChatRoom/emptyStatus",
                            component:Empty
                        },
                        {
                            // 
                            path:"/ChatRoom/startSession",
                            component:SessionWindow
                        },
                    ]
                }            
            ]
        },
        {
            path: "/",
            component: Login,
        }
]


const router = createRouter({
    // 使用 history 模式
    history: createWebHistory(),
    // 路由规则
    routes,
})

export default router;